package models;

import java.util.Date;

import play.data.validation.Required;
import play.db.jpa.Model;

import javax.persistence.*;

@Entity
public class FicheEchelle extends Model{
	
	@Required
	@ManyToOne
	public Agent agent;
	
	@Required
	@ManyToOne
	public CIS cis;
	
	@ManyToOne
	public MoyenEchelle moyen;
	
	@ManyToOne
	public RoleEchelle role;
	
	@Required
	public Date date;
	
	@ManyToOne
	public Duree duree;
	
	@ManyToOne
	public CadreUtilisationEchelle cadre;
	
	public FicheEchelle(Agent agent, CIS cis, MoyenEchelle moyen, RoleEchelle role,
			Date date, Duree duree, CadreUtilisationEchelle cadre) {
		this.agent = agent;
		this.cis = cis;
		this.moyen = moyen;
		this.role = role;
		this.date = date;
		this.duree = duree;
		this.cadre = cadre;
	}
	
	public boolean equals(FicheEchelle f){
		return f.agent.equals(this.agent)&&f.moyen.equals(this.moyen)&&f.date.equals(f.date);
	}
}
